I'm developing a library to control MS-Word. Anybody got suggestions for features I would want to turn off when exporting to word?
//***************************************************************
bool fWord_OleOK(string in_ErrMess)
{ // If there is an error then <<deal with it>> and return false
// If there is no error then return true
// This function is intended as a wrapper to the various "ole" commands that return string error messages
// e.g. if (!fWord_OleOK(oleMethod (oaoDocs, "Add", oaaArgs, oaoDocNew)))
// then error
// else proceed
//<<code stubbed>> Landale deals with it in a complicated way
if (!null in_ErrMess) print "OLE command error: '" in_ErrMess "'\n"
return(!null in_ErrMess)
} // end fWord_OleOK()
//***************************************************************
bool fWord_Spelling(OleAutoObj in_oaoDocs, bool in_OnOff)
{ // For the given Word "Documents" Object, turn Spelling and Grammar either On or Off
// Return whether it seemed to work
if (null in_oaoDocs) return(false)
OleAutoObj oaoOpts = null
bool Result = false
oleGet(in_oaoDocs, "Options", oaoOpts)
if (!null oaoOpts)
{ if (fWord_OleOK(olePut(oaoOpts, "CheckSpellingAsYouType", in_OnOff)) and
fWord_OleOK(olePut(oaoOpts, "CheckGrammarAsYouType", in_OnOff))) //
then Result = true
else Result = false
oleCloseAutoObject(oaoOpts)
}
else Result = false
return(Result)
} // end fWord_Spelling()
//***************************************************************
bool fWord_OptionsOff(OleAutoObj in_oaoDocs)
{ // For the given Word "Documents" Object, turn off the various Word options
// Spelling, Grammar, Track Revisions, Show Revisions
// Return whether it seemed to work
if (null in_oaoDocs) return(false)
OleAutoObj oaoOpts = null
bool Result = false
oleGet(in_oaoDocs, "Options", oaoOpts)
if (!null oaoOpts)
{ if (fWord_OleOK(olePut(oaoOpts, "CheckSpellingAsYouType", false)) and
fWord_OleOK(olePut(oaoOpts, "CheckGrammarAsYouType", false)) and
fWord_OleOK(olePut(oaoOpts, "TrackRevisions", false)) and
fWord_OleOK(olePut(oaoOpts, "ShowRevisions", false))) //
then Result = true
else Result = false
oleCloseAutoObject(oaoOpts)
}
else Result = false
return(Result)
} // end fWord_OptionsOff()
llandale - Fri Feb 15 09:41:27 EST 2013 |
Re: fWord Library thoughts Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: fWord Library thoughts Paul Miller, Melbourne, Australia |
Re: fWord Library thoughts
Hello Louie,
WEXP_wordOptions<-"CheckSpellingAsYouType" = false
WEXP_wordOptions<-"CheckGrammarAsYouType" = false
WEXP_wordOptions<-"AllowFastSave" = false
WEXP_wordOptions<-"BackgroundSave" = false
WEXP_wordOptions<-"SaveInterval" = 0
// switch to Word Master View
WEXP_objView<-"Type" = wdMasterView
|